The field of the present invention relates to optical devices incorporating distributed optical structures. In particular, methods and apparatus for optical waveform recognition and/or generation and for optical switching, with distributed optical structures, are disclosed herein.